<%@ page contentType="text/html; charset=utf-8"%><%@ taglib prefix="novatar" uri="/novatar-tags"%>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0"/>
<novatar:head title="home" />
<style type="text/css">
<!--
div.test {
    position: absolute;
    display: flex;
    left : 0;
    top: 0;
    width: 100%;
    height: 100%;
}
div.msg {
    position:absolute;
    top:10px;
    left:0;
    padding-left:5%;
    width: 70%;
    text-align: left;
}
#serviceCnt{
    width:100%;
    height:400px;
    word-wrap: break-word;
    word-break: normal;
}
#sayHiClient{
    width:100%;
    height:40px;
}
-->
</style>
</head>
<body style="display:-webkit-box">
    <div class="test" >
        <div class="msg">
            <h2>Cxf Webservice HelloWorld 测试打开页面！</h2>
            <textarea id="serviceCnt" readOnly></textarea>
            <textarea id="sayHiClient" readOnly></textarea>
        </div>
    </div>
    <script>
        $.ajax({
            url : "${contextPath}/ws/HelloWorld?wsdl",
            success : function(data) {
                $("#serviceCnt").val(data);
            },
            error : function() {
                $("#serviceCnt").val("  Cxf WebService is NOT actived!");
            },
            dataType : "text"
        });
        $.ajax({
            url : "${contextPath}/sample/sayHi.pvt",
            data : {
                name : 'novatar'
            },
            type : "post",
            success : function(resp) {
                if (resp.success == true) {
                    $("#sayHiClient").val("  Service invoke result : " + resp.msg);
                } else {
                    $("#sayHiClient").val("  Service invoke failed!");
                }
            },
            error : function() {
                $("#sayHiClient").val("  Cxf WebService is NOT actived!");
            }
        });
    </script>
</body>
</html>